---
image: /generated/articles-docs-renderer-select-composition.png
title: selectComposition()
id: select-composition
crumb: '@remotion/renderer'
---

# selectComposition()<AvailableFrom v="4.0.0"/>

Evaluates the list of compositions from a [Remotion Bundle](/docs/terminology/bundle) by evaluating the [Remotion Root](/docs/terminology/remotion-root) and evaluating `calculateMetadata()` on the specified [composition](/docs/terminology/composition).

If you want to get a list of all compositions, use [`getCompositions()`](/docs/renderer/get-compositions).

If no composition with the specified [ID](/docs/terminology/composition#composition-id) exists, then this function will throw.

```tsx twoslash title="Example"
// ---cut---
import {bundle} from '@remotion/bundler';
import {selectComposition} from '@remotion/renderer';

const bundled = await bundle({entryPoint: require.resolve('./src/index.ts')});
const composition = await selectComposition({
  serveUrl: bundled,
  id: 'MyComposition',
  inputProps: {},
});

console.log(composition.id); // "MyComposition"
console.log(composition.width, composition.height);
console.log(composition.fps, composition.durationInFrames);
```

## API

Accepts an object with the following properties:

### `serveUrl`

A string pointing to a [Remotion Bundle](/docs/terminology/bundle) generated by [`bundle()`](/docs/bundle) or a URL that hosts the the bundled Remotion project.

### `id`

The [ID](/docs/terminology/composition#composition-id) of the composition you want to evaluate.

### `inputProps`

_optional in &lt;5.0, required from 5.0_

[Input Props to pass to the selected composition of your video.](/docs/passing-props#passing-input-props-in-the-cli).  
Must be a JSON object.  
From the root component the props can be read using [`getInputProps()`](/docs/get-input-props).  
You may transform input props using [`calculateMetadata()`](/docs/calculate-metadata).

### `logLevel?`

<Options id="log" />

### `port?`

Prefer a specific port that will be used to serve the Remotion project. If not specified, a random port will be used.

### `chromiumOptions?`

See: [Chromium Flags](/docs/chromium-flags)

### `timeoutInMilliseconds?`

A number describing how long the render may take to resolve all [`delayRender()`](/docs/delay-render) calls [before it times out](/docs/timeout). Default: `30000`

### `browserExecutable?`

A string defining the absolute path on disk of the browser executable that should be used. By default Remotion will try to detect it automatically and download one if none is available.

### `onBrowserLog?`

Gets called when your project calls `console.log` or another method from console. See the documentation for [`renderFrames`](/docs/renderer/render-frames#onbrowserlog) for more information.

### `puppeteerInstance?`

An already open [`Browser`](/docs/renderer/open-browser) instance. Use [`openBrowser()`](/docs/renderer/open-browser) to create a new instance. Reusing a browser across multiple function calls can speed up the rendering process. You are responsible for opening and closing the browser yourself. If you don't specify this option, a new browser will be opened and closed at the end.

:::note
Despite the name, not actually compatible with `puppeteer`, only with [`openBrowser()`](/docs/renderer/open-browser).
:::

### `envVariables?`

An object containing environment variables to be injected in your project.

See: [Environment variables](/docs/env-variables/)

### `mediaCacheSizeInBytes?`<AvailableFrom v="4.0.352"/>

<Options id="media-cache-size-in-bytes" />

### `offthreadVideoCacheSizeInBytes?`<AvailableFrom v="4.0.23"/>

<Options id="offthreadvideo-cache-size-in-bytes" />

### `offthreadVideoThreads?`<AvailableFrom v="4.0.261"/>

<Options id="offthreadvideo-video-threads" />

### `binariesDirectory?`<AvailableFrom v="4.0.120" />

<Options id="binaries-directory" />

### `chromeMode?`<AvailableFrom v="4.0.248" />

<Options id="chrome-mode" />

### `onBrowserDownload?`<AvailableFrom v="4.0.137" />

<Options id="on-browser-download" />

## See also

- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/renderer/src/select-composition.ts)
- [Server-Side rendering](/docs/ssr)
- [`getCompositions()`](/docs/renderer/get-compositions)
- [`bundle()`](/docs/bundle)
